package cn.fengwoo.springBoot.entity;

import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @Description: 用户表
 * Created by fangdaji on 2018/1/10.
 */
@Entity
@Table(name = "s_user", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
public class User implements java.io.Serializable{

    /** 用户id */
    @ApiModelProperty(value = "用户id")
    private Integer id;

    /** 用户名 */
    @ApiModelProperty(value = "用户名")
    private String name;

    /** 密码 */
    @ApiModelProperty(value = "密码")
    private String password;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name ="ID",nullable=false,precision=10,scale=0)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
